Skip to content

Lock a question when submitter is deleted #6575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 21, 2025

Conversation

akatsoulas
Copy link
Collaborator

No description provided.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements changes to lock questions and add explanatory answers when the original submitter's account is deleted.

  • Reassign questions and answers to SumoBot and lock questions
  • Add an explanatory answer for each locked question
  • Update votes to be either anonymized or disassociated from the deleted user

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
kitsune/questions/tests/test_handlers.py Adds a test to validate question locking, reassignment, and answer notification
kitsune/questions/handlers.py Implements the locking mechanism and explanatory answer creation when an account is deleted
Comments suppressed due to low confidence (1)

kitsune/questions/tests/test_handlers.py:149

  • [nitpick] Consider adding an assertion to verify that the number of explanatory answers equals the number of questions reassigned, to ensure complete test coverage for the bulk creation behavior.
last_answer = question.answers.order_by("-created")[0]

Copy link
Contributor

@escattone escattone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+wc

@akatsoulas akatsoulas merged commit 5853e40 into mozilla:main Mar 21, 2025
2 checks passed
@akatsoulas akatsoulas deleted the lock-questions branch March 21, 2025 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants